<ul class="pagination">
    @if($paginator->page >1)
    <?
    $PrevStart = $paginator->page - 1;
    ?>
    <li>
        <a href="{{$paginator->url}}1" rel="prev">|<<</a>
    </li>
    <li>
        <a href="{{$paginator->url}}{{$paginator->equals}}{{$PrevStart}}"><<</a></li>
    @endif
    <?
    for ($c = $paginator->counterstart; $c <= $paginator->counterend; $c++) {
        if ($c < $paginator->maxpage) {
            if ($c == $paginator->page) {
                if ($c % $paginator->pagesize == 0) {
                    echo '<li class="active"><span>' . $c . '</span></li>';
                } else {
                    echo '<li class="active"><span>' . $c . '</span></li>';
                }
            } elseif ($c % $paginator->pagesize == 0) {
                echo '<li><a href="' . $paginator->url . $paginator->equals . $c . '" >' . $c . '</a></li>';
            } else {
                echo '<li><a href="' . $paginator->url . $paginator->equals . $c . '" >' . $c . '</a></li>';
            }
        } else {
            if ($paginator->page == $paginator->maxpage) {
                echo '<li class="active"><span>' . $c . '</span></li>';
                break;
            } else {
                echo '<li><a href="' . $paginator->url . $paginator->equals . $c . '">' . $c . '</a></li>';
                break;
            }
        }
    }
    if ($paginator->page < $paginator->maxpage) {
        $NextPage = $paginator->page + 1;
        echo '<li><a href="' . $paginator->url . $paginator->equals . $NextPage . '"> >></a></li>';
    }
    if ($paginator->counterend < $paginator->maxpage) {
        $LastRec = $paginator->recordcount % $paginator->pagesize;
        if ($LastRec == 0) {
            $LastStartRecord = $paginator->recordcount - $paginator->pagesize;
        } else {
            $LastStartRecord = $paginator->recordcount - $LastRec;
        }
        echo '<li><a href="' . $paginator->url . $paginator->equals . $paginator->maxpage . '"> >>|</a></li>';
    }
    ?>
</ul>